

#include "MouseRecorder.h"

namespace abliefern {
	
	
	MouseRecorder::MouseRecorder(){
		_myPointer = 0;
		_myPoints.clear();
	}
	
	void MouseRecorder::addPosition(float theX, float theY){
		_myPoints.push_back(Point2f(theX, theY));
	}
	
	Point2f MouseRecorder::get(){
		return _myPoints.at(_myPointer);
	}
	
	void MouseRecorder::clear(){
		_myPoints.clear();
		_myPointer = 0;
	}
	
	void MouseRecorder::reset(){
		_myPointer = 0;
	}
	
	int MouseRecorder::position(){
		return _myPointer;
	}
	
	int MouseRecorder::length(){
		return _myPoints.size();
	}
	
	void MouseRecorder::advance(){
		if(_myPointer < _myPoints.size() - 1) _myPointer++;
	}
	
	bool MouseRecorder::isAtEnd(){
		
		return (_myPointer >= _myPoints.size()-1);
	}
	
	
}
